#!/bin/sh
. configure.paths

install -m 755 WebDAV $CONFIG_BINPATH/WebDAV

if [ `whoami` = "root" ]; then
  etcpath=/etc
else
  if [ -d "${HOME}/.etc" ]; then
    etcpath="${HOME}/.etc"
  else
    mkdir -p "${HOME}/etc"
    etcpath="${HOME}/etc"
  fi
  mkdir -p "${HOME}/var/run"
fi

if [ ! -e "${etcpath}/WebDAV.conf" ]; then
  cp rsrc/WebDAV.conf "$etcpath"/WebDAV.conf
fi
